var file = GeGetStartupPath(); file->AddLast("plugins"); file->AddLast("bench"); file->AddLast("flythrough"); file->AddLast("flythrough.c4d");
t2 = ShadeIt_2(file,SHADING_FAC,teststring);
if (t2!=0.0) e2 = 12502.0/t2;
println("Scene 2:");
t1 = ShadeIt_1(x1,teststring);
if (t1!=0.0) e1 = 3732.4/t1;
SetMousePointer(MOUSE_SHOW);
return (e1+e2)/2.0;
}
// ************************ make a dialog class ********************************************
enum
{
B_COMPLETE = 4000,
B_RENDER,
B_RENDER_M,
B_CINEMA,
B_OPENGL_SW,
B_OPENGL_HW,
B_CLIP1,
B_CLIP2,
R_RENDER,
R_RENDER_M,
R_CINEMA,
R_OPENGL_SOFT,
R_OPENGL_HARD,
R_GAIN_MP,
R_GAIN_OGLHW_OGLSW,
R_RM1,
R_RM2,
B_INFO_NAME,
B_INFO_MACH,
B_INFO_MHZ,
B_INFO_OS,
B_INFO_GFX,
B_ABOUT0,
B_ABOUT1,
B_ABOUT2,
B_ABOUT3,
B_ABOUT4
}
class MyDialog : GeDialog
{
private:
var start,rendermode,multi;
public:
MyDialog();
CreateLayout();
Command(id,msg);
UpdateDialog();
Init();
CoreMessage(id,msg);
Timer(msg);
BringToFront(managerid);
AllTestsDone();
Test1();
Test2();
Test_C4D_Shading();
Test_OGL_SW();
Test_OGL_HW();
OptEnable();
StartAllTests();
}
MyDialog::MyDialog()
{
super(PLUGIN_ID);
rendermode = -1;
multi = FALSE;
}
MyDialog::BringToFront(managerid)
{
var msg = new(BaseContainer,'show');
msg->SetData('id',managerid);
SendCoreMessage(0xC0FFEE,msg,0);
}
MyDialog::AllTestsDone()
{
if (!AUTORUN) return;
var t;
var le;
le = GeGetLineEnd();
t = "CINEBENCH 2003 "+le;
t += "Rendering (Single CPU) : "; if (render_1_cb!=0.0) t += tostring(render_1_cb,".0f"); else t += "---"; t += " CB-CPU"; if (render_1_time!=0.0) t += ", "+tostring(render_1_time,".1f")+" sec"; t += le;
t += "Rendering (Multiple CPU) : "; if (render_x_cb!=0.0) t += tostring(render_x_cb,".0f"); else t += "---"; t += " CB-CPU"; if (render_x_time!=0.0) t += ", "+tostring(render_x_time,".1f")+" sec"; t += le;
t += "Shading (CINEMA 4D) : "; if (c4d_shad_cb!=0.0) t += tostring(c4d_shad_cb,".0f"); else t += "---"; t += " CB-GFX"+le;
t += "Shading (OpenGL Software Lighting) : "; if (ogl_soft_cb!=0.0) t += tostring(ogl_soft_cb,".0f"); else t += "---"; t += " CB-GFX"+le;
t += "Shading (OpenGL Hardware Lighting) : "; if (ogl_hard_cb!=0.0) t += tostring(ogl_hard_cb,".0f"); else t += "---"; t += " CB-GFX"+le;
t += le;
SetClipboardData(t);
println("AUTORUN complete\n");
Sleep(2);
shutdown();
}
MyDialog::CoreMessage(id,msg)
{
if (id==-1003 && rendermode!=100)
{
var diff = msg->GetData(BFM_CORE_PAR2);
if (diff==-1)
{
println("Rendering aborted\n");
}
else
{
if (rendermode==0)
{
render_1_time = diff/1000.0;
if (diff!=0.0) render_1_cb = 1.0 / render_1_time * 26320.0;
if (!(GetCPUCount()>1 && multi))
{
BringToFront(PLUGIN_ID);
AllTestsDone();
}
println(tostring(render_1_time,".1f")," sec");
}
else if (rendermode==1)
{
render_x_time = diff/1000.0;
if (diff!=0.0) render_x_cb = 1.0 / render_x_time * 26320.0;
multi=FALSE;
BringToFront(PLUGIN_ID);
println(tostring(render_x_time,".1f")," sec");
AllTestsDone();
}
}
var d = GetActiveDocument();
KillDocument(d);
rendermode = -1;
Init();
println(" ");
}
}
MyDialog::CreateLayout()
{
SetTitle("CINEBENCH 2003");
SetTimer(1000);
if (AUTORUN)
{
autoruntime = time();
println("CINEBENCH 2003 AUTORUN\nplease wait until all tests are done!\n");